#!/usr/bin/env ruby
# -*- coding: us-ascii -*-

module Handy4Testing
  def stress(num_times_ave, &block)
    r = rand(num_times_ave*2) + 1
    r.times { yield }
  end
end

########################################

if $0 == __FILE__
  include Handy4Testing
  
  a, n, count = [], 5, 0
  stress(n) do
    count += 1
    a << 'STRESS'
  end
  puts "#{a.join(' ')} #{count} time(s)"
  
  raise "I'm not doing enough." unless count > 0
  raise "I have way too much to do!" unless count < n*3
end
